<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <link rel="shortcut icon" href="./favicon.svg" type="image/svg+xml"/>
        <link rel="stylesheet" href="./vender/jquery/zTreeStyle/zTreeStyle.css" type="text/css">
        <script src = "./vender/jquery/jquery.js"></script>
        <script src = "./vender/date97/WdatePicker.js"></script>
        <script src = "./vender/jquery/jquery.ztree.core.min.js"></script> 
        <script src = "./vender/jquery/jquery.ztree.exedit.min.js"></script>
        <script src = "./vender/jquery/jquery.ztree.exhide.min.js"></script>
        <script src = "./vender/codemirror.js"></script>
        <script src = "./vender/fabric.js"></script>
        <script src="./vender/requirejs/require.js"></script> 
        <script>
            require.config({
                baseUrl: 'http://localhost:81/src',
                paths: {'editor': 'editor'}
            })

            require(['editor'], function () {

                //配置项可以不设置，会使用默认设置
                let option = {
                    license:'AcbAuhJW9c1Txypz/BSS+Dz4iTE6rz9z69uqrnG4VBbz7OtniDM+YSpR2ojvyPOtwKF9GHWWlHQUv5ThaLRdKW7BSyRCGNOhOQWGZcil/Gr9Aiv35U3HG3fq/pHsBzu5A1rxSlWJNtaQB4LrBunGpf2/wnH7YCLB9pB3ian35ho=',
                    mode:'form',  //默认模式 form:表单模式，design:设计模式
                    pdfUrl:'https://www.x-emr.cn/pdf/post',  //pdf生成服务
                    dictionary: [  //知识库
                        {name: '体征', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=20', itemUrl:'https://www.x-emr.cn/dictitem'},
                        {name: '症状', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=20', itemUrl:'https://www.x-emr.cn/dictitem'},
                        {name: '卫生信息数据元', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=40', itemUrl:'https://www.x-emr.cn/dictitem'},
                        {name: '电子病历数据集', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=50', itemUrl:'https://www.x-emr.cn/dictitem'},
                        {name: '国家医保标准', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=80', itemUrl:'https://www.x-emr.cn/dictitem'},
                        {name: '省数据平台标准', isParent:true, treeUrl:'https://www.x-emr.cn/dict?category=90', itemUrl:'https://www.x-emr.cn/dictitem'},
                    ]
                }

                //从模块的Editor组件中获取mode，doc，lang属性 (该段代码可删除)
                let mode = window.frameElement.getAttribute('mode')
                let doc = window.frameElement.getAttribute('doc')
                let lang = window.frameElement.getAttribute('lang')
                mode? option.mode = mode: null
                lang? option.lang = lang: null

                //初始化编辑器（初始化代码可以放入组件的load事件中）
                editor.init(option).then(()=>{
                    doc? editor.loadUrl(doc) : null
                })

            })
      </script>
    </head>
    <body></body>
</html>
